﻿using System;
using System.Linq.Expressions;
using K9Nano.MultiTenancy;

namespace K9Nano.Application.MultiTenancy
{
    public class TenantPagedInput : PagedInputDto<Tenant>
    {
        public string Name { get; set; }

        public override Expression<Func<Tenant, bool>> Predicate()
        {
            if (string.IsNullOrWhiteSpace(Name)) return null;

            return x => x.Name.Contains(Name) || x.DisplayName.Contains(Name);
        }
    }
}